/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.team1160.breakaway;

import com.team1160.breakaway.ballControl.Dribbler;
import com.team1160.breakaway.ballControl.Kicker;
import com.team1160.breakaway.drive.Drive;
import com.team1160.breakaway.exceptions.IDException;
import com.team1160.breakaway.exceptions.TargetNotSeenException;
import com.team1160.breakaway.pneumatics.Pneumatics;
import com.team1160.breakaway.stateManager.TaskManager;

/**
 *
 * @author Team 1160 Firebird Robotics 
 */
public class Robot implements TaskManager{

    protected final Drive DRIVE_TRAIN = new Drive();
    protected final Dribbler DRIBBLER = new Dribbler();
    protected final Pneumatics PNEUMATICS = new Pneumatics();
    protected final Kicker KICKER = new Kicker();






    /**
     * sets left DRIVE_TRAIN values to lValue and right DRIVE_TRAIN values to rValue
     * @param move the forward movement speed
     * @param turn the turn rate
     */
    public void drive(double move, double turn) {

        DRIVE_TRAIN.drive(move, turn);
    }

    /**
     * starts or stops dribbler depending on value
     * @param value true starts dribbler and false stops it
     */
    public void setDribbler(boolean value) {
        if(value){
            DRIBBLER.start();
        }else{
            DRIBBLER.stop();
        }
    }

    /**
     * fires kicker
     */
    public void shoot() {
        this.KICKER.shoot();
    }


    /**
     * moves robot to face the target
     * @throws TargetNotSeenException
     */
    public void orientToTarget() throws TargetNotSeenException {
            //TODO Code orientToTarget logic here
    }

    public double getMove(){
        return this.DRIVE_TRAIN.getMove();
    }

    public double getTurn(){
        return this.DRIVE_TRAIN.getTurn();
    }



}
